<?php

error_reporting(E_ALL);

/**
 * untitledModel - class.Usuarios.php
 *
 * $Id$
 *
 * This file is part of untitledModel.
 *
 * Automatically generated on 27.11.2011, 19:02:44 with ArgoUML PHP module 
 * (last revised $Date: 2010-01-12 20:14:42 +0100 (Tue, 12 Jan 2010) $)
 *
 * @author firstname and lastname of author, <author@example.org>
 */

if (0 > version_compare(PHP_VERSION, '5')) {
    die('This file was generated for PHP 5');
}

/* user defined includes */
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178D-includes begin
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178D-includes end

/* user defined constants */
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178D-constants begin
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178D-constants end

/**
 * Short description of class Usuarios
 *
 * @access public
 * @author firstname and lastname of author, <author@example.org>
 */
class Usuarios
{
    // --- ASSOCIATIONS ---


    // --- ATTRIBUTES ---

    /**
     * Short description of attribute row
     *
     * @access public
     * @var Array
     */
    public $row = null;

    /**
     * Short description of attribute ModeloUsr
     *
     * @access public
     * @var String
     */
    public $ModeloUsr = null;

    // --- OPERATIONS ---

    /**
     * Short description of method Usuarios
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function Usuarios()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E0 begin
		 //$this->ModeloUsr = new ModeloUsr();
        session_start();
		
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E0 end
    }

    /**
     * Short description of method IsAdmin
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function IsAdmin()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E2 begin
		 if (@$_SESSION["usuario"]["nivel"] == "1") { 
        	return true;
        }
        else {
        	return false;
        }        
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E2 end
    }

    /**
     * Short description of method IsTeacher
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function IsTeacher()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E4 begin
		 if (@$_SESSION["usuario"]["nivel"] == "2") { 
        	return true;
        }
        else {
        	return false;
        }        
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E4 end
    }

    /**
     * Short description of method LogOut
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function LogOut()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E6 begin
		$_SESSION["usuario"] = "";
        session_unset();     
        @session_destroy();
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E6 end
    }

    /**
     * Short description of method IsLogged
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function IsLogged()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E8 begin
		  if (@$_SESSION["usuario"] == null)
        	return false;
        else
        	return true;
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017E8 end
    }

    /**
     * Short description of method IsRegisterUser
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function IsRegisterUser()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017EA begin
		 if (@$_SESSION["usuario"]["nivel"] == "3") { 
        	return true;
        }
        else {
        	return false;
        }  
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017EA end
    }

} /* end of class Usuarios */

?>